package com.lzy.api.controller.user;

import com.lzy.api.config.MyServiceList;
import com.lzy.api.controller.user.fallbacks.UserControllerFactoryFallback;
import com.lzy.grace.result.GraceJSONResult;
import com.lzy.pojo.bo.RegistLoginBO;
import com.lzy.pojo.bo.UpdateUserInfoBO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;

@Api(value = "用户信息相关controller", tags = {"用户信息相关controller"})
@RequestMapping("user")
@FeignClient(value = MyServiceList.SERVICE_USER, fallbackFactory = UserControllerFactoryFallback.class) // 获取远程SERVICE_USER服务，并加载进入容器
public interface UserControllerApi {

    @PostMapping("/getUserInfo")
    @ApiOperation(value = "获得用户基础信息", notes = "获得用户基础信息", httpMethod = "POST")
    public GraceJSONResult getUserInfo(@RequestParam String userId);

    @PostMapping("/getAccountInfo")
    @ApiOperation(value = "获得用户账户信息", notes = "获得用户账户信息", httpMethod = "POST")
    public GraceJSONResult getAccountInfo(@RequestParam String userId);

    @PostMapping("/updateUserInfo")
    @ApiOperation(value = "完善用户信息", notes = "完善用户信息", httpMethod = "POST")
    public GraceJSONResult updateUserInfo(@RequestBody @Valid UpdateUserInfoBO updateUserInfoBO);

    @GetMapping("/queryByIds")
    @ApiOperation(value = "根据用户id查询用户", notes = "根据用户id查询用户", httpMethod = "GET")
    public GraceJSONResult queryByIds(@RequestParam String userIds);

}



